<?php
/*
 * Created on Dec 3, 2011
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

$sensor_id = $_POST['sunspot']; 
$start = $_POST['start']; 
$stop = $_POST['end']; 


$graphArray = $_POST['graphcb']; 
 
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Graph Data</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.6.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-replace.js"></script>
<script type="text/javascript" src="js/Swis721_Cn_BT_400.font.js"></script>
<script type="text/javascript" src="js/Swis721_Cn_BT_700.font.js"></script>
<script type="text/javascript" src="js/tabs.js"></script>
<!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
	<style type="text/css">
		.bg{ behavior: url(js/PIE.htc); }
	</style>
<![endif]-->
<!--[if lt IE 7]>
		<div style=' clear: both; text-align:center; position: relative;'>
			<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/images/upgrade.jpg" border="0"  alt="" /></a>
		</div>
<![endif]-->
</head>
<body id="page5">
	<div class="body1">
	<div class="body2">
	<div class="body5">
		<div class="main">
<!-- header -->
			<?php include("wsnheader.html"); ?>
<!-- header end-->
		</div>
	</div>
	</div>
	</div>
	<div class="body3">
		<div class="main">
<!-- content -->
			<article id="content">
				<div class="wrapper">
				
					<?php 
					//graphxml.php?sensor_id=30&start=2011-11-30 08:15:41&stop=2011-11-30 08:16:05
					//echo "graphxml.php?sensor_id=$sensor_id&start=$start&stop=$stop";
										
if(!empty($graphArray))
  {
    $N = count($graphArray);
    
  	echo "<table border=\"0\">";
    for($i=0; $i < $N; $i++)
    {
      //echo($aDoor[$i] . " ");
  				
		
	
		echo "<tr>";
		echo "<h2>".$graphArray[$i]."</h2>";
		echo "<script type=\"text/javascript\" src=\"amline/swfobject.js\"></script>";
		echo "<div id=\"flashcontent".$i."\">";
		echo "<strong>You need to upgrade your Flash Player</strong>";
		echo "</div>";
		echo "<script type=\"text/javascript\">";
		echo "var so = new SWFObject(\"amline/amline.swf\", \"amline\", \"420\", \"400\", \"8\", \"#FFFFFF\");";
		echo "so.addVariable(\"path\", \"amline/\");";
		echo "so.addVariable(\"settings_file\", escape(\"amline/graph3.xml\"));";
		echo "so.addVariable(\"data_file\", escape(\"http://192.168.3.1/wsn/graphxml.php?sensor_id=$sensor_id&start=$start&stop=$stop&type=$graphArray[$i]\"));";
		echo "so.addVariable(\"preloader_color\", \"#999999\");";
		echo "so.write(\"flashcontent".$i."\");";
		echo "</script>";
		echo "</tr>";
		
		

  	}
  	echo "</table>";
  }					
					?>
					
					
				</div>

			</article>
		</div>
	</div>
	
<!-- content end -->
<!-- footer -->
			<?php include("footer.html"); ?>
<!-- footer end -->
<script type="text/javascript"> Cufon.now(); </script>
<script>
	$(document).ready(function() {
		tabs.init();
	})
</script>
</body>
</html>
